<?php
/*
Plugin Name: Plug In Studios Dashboard Notification
Plugin URI: https://code.google.com/p/pluginstudiosunb
Version: 1.0
Author: Kristian Matthews
License: GPL3
*/

// Register activation hook
function pisdn_register_activation_hook() {
	add_option('pisdn_notification', 'Default', '', 'yes');
}
register_activation_hook(__FILE__,'pisdn_register_activation_hook');

// Register deactivation hook
function pisdn_register_deactivation_hook() {
	delete_option('pisdn_notification');
}
register_deactivation_hook( __FILE__, 'pisdn_register_deactivation_hook');

// All admin notices
if (get_option('pisdn_notification')!=null){
	function pisdn_admin_notices() {
		echo '<div class="updated"><p>'.get_option('pisdn_notification').'</p></div>';
	}
	add_action('all_admin_notices', 'pisdn_admin_notices');
}

// Admin menu
if ( is_admin() ){
	function pisdn_admin_menu() {
		//add_menu_page('Plug In Studios','Plug In Studios','manage_options','pis','pis_admin',plugins_url('img/pis16.png',__FILE__ ));
		add_submenu_page('pis','Dashboard Notification','Dashboard Notification','administrator','pisdn','pisdn_admin');
	}
	/*function pis_admin() {
		include('pis_admin.php');
	}*/
	function pisdn_admin() {
		include('pisdn_admin.php');
	}
	add_action('admin_menu', 'pisdn_admin_menu');
}

?>